package com.devops.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.devops.admin.model.DOSProjectUserRelation;
import com.devops.admin.po.DOSUserPo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @ClassNem DOSProjectUserRelationMapper
 * @Description TODO
 * @Author heyabo
 * @Date 2022/3/23 09:25
 * @Version 1.0
 **/
@Mapper
public interface DOSProjectUserRelationMapper extends BaseMapper<DOSProjectUserRelation> {


    /**
     * @Author heyabo
     * @Description 获取项目所在项目组的成员
     * @Date 11:36 2022/9/6
     * @Param [projectId]
     * @return java.util.List<com.devops.admin.po.DOSUserPo>
     **/
    List<DOSUserPo> getGroupUsers(Integer projectId);

    /**
     * 根据relationId查询groupId;
     * @param relationId
     * @return
     */
    Integer getGroupIdByRelationId(Integer relationId);

    /**
     * 处理项目各种人员
     * @param projectId
     * @param userType
     * @param roleCodes
     * @return
     */
    List<DOSUserPo> getProjectUsers(@Param("projectId") Integer projectId,
                                    @Param("userType") Integer userType,@Param("roleCodes") List<String> roleCodes);
}
